package com.mhys.hms.service.user.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mhys.hms.entity.User;
import com.mhys.hms.mapper.UserManagerMapper;
import com.mhys.hms.service.user.UserService;

@Service
public class UserServiceImpl implements UserService{
	@Autowired
	private UserManagerMapper userManagerMapper;
	
	/**
	 * 新增账号
	 */
	@Override
	public Integer addUser(User user) {
		return userManagerMapper.addUser(user);
	}
	/**
	 * 根据账号名称查找账号
	 */
	@Override
	public List<User> queryUserByCount(String countName) {
		return userManagerMapper.queryUserByCount(countName);
	}
	/**
	 * 分页模糊条件查询
	 * @param curPage
	 * @param pageSize
	 * @param userNo
	 * @param userName
	 * @return
	 */
	@Override
	public List<User> getUserInfo(int curPage, int pageSize, String userNo, String userName) {
		int startNum = (curPage - 1) * pageSize;
		return userManagerMapper.getUserInfo(startNum, pageSize, userNo, userName);
	}
	/**
	 * 模糊查询总条数
	 * @param userNo
	 * @param userName
	 * @return
	 */
	@Override
	public int getUserCount(String userNo, String userName) {
		return userManagerMapper.getUserCount(userNo, userName);
	}
	/**
	 * 逻辑删除
	 */
	@Override
	public int delUserById(String id) {
		return userManagerMapper.delUserById(id);
	}

}
